import http from "../common/api/index.js"
// #ifndef VUE3
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
			// #endif

			// #ifdef VUE3
			import {
				createStore
			} from 'vuex'
			const store = createStore({
				// #endif
				state: {
					userInfo: {}, //用户信息
					fontSize: 100,
					showLoading: false,
					theme: ''
				},
				getters: {},
				mutations: {
					setUserinfo(state, data) {
						state.userInfo = data
					},
				},
				actions: {
					// 获取用户信息
					async queryUserInfo({
						commit,
						state
					}) {
						const data = await http.queryUserInfo()
						console.log("vuex 获取用户信息", data);
						// if (code === 200) {
						// 	commit("setUserinfo", res)
						// }
					},
				}
			})
			export default store